home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / CIncludes / Sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  63.5 KB  |  1,670 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Sound.h
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.3
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1986-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __SOUND__
  18. #define __SOUND__
  19.  
  20. #ifndef __MACTYPES__
  21. #include <MacTypes.h>
  22. #endif
  23. #ifndef __DIALOGS__
  24. #include <Dialogs.h>
  25. #endif
  26. #ifndef __COMPONENTS__
  27. #include <Components.h>
  28. #endif
  29. #ifndef __MIXEDMODE__
  30. #include <MixedMode.h>
  31. #endif
  32. #ifndef __MOVIES__
  33. #include <Movies.h>
  34. #endif
  35.  
  36.  
  37.  
  38. #if PRAGMA_ONCE
  39. #pragma once
  40. #endif
  41.  
  42. #ifdef __cplusplus
  43. extern "C" {
  44. #endif
  45.  
  46. #if PRAGMA_IMPORT
  47. #pragma import on
  48. #endif
  49.  
  50. #if PRAGMA_STRUCT_ALIGN
  51.     #pragma options align=mac68k
  52. #elif PRAGMA_STRUCT_PACKPUSH
  53.     #pragma pack(push, 2)
  54. #elif PRAGMA_STRUCT_PACK
  55.     #pragma pack(2)
  56. #endif
  57.  
  58. /*
  59.                         * * *  N O T E  * * *
  60.  
  61.     This file has been updated to include Sound Manager 3.3 interfaces.
  62.  
  63.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  64.     that originally shipped with the PowerMacs. These missing functions and the
  65.     new 3.3 interfaces have been released in the SoundLib library for PowerPC
  66.     developers to link with. The runtime library for these functions are
  67.     installed by the Sound Manager. The following functions are found in SoundLib.
  68.  
  69.         GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  70.         UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  71.         SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  72.         SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  73.         SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  74.         AudioGetBass(), AudioGetInfo(), AudioGetMute(), AudioGetOutputDevice(),
  75.         AudioGetTreble(), AudioGetVolume(), AudioMuteOnEvent(), AudioSetBass(),
  76.         AudioSetMute(), AudioSetToDefaults(), AudioSetTreble(), AudioSetVolume(),
  77.         OpenMixerSoundComponent(), CloseMixerSoundComponent(), SoundComponentAddSource(),
  78.         SoundComponentGetInfo(), SoundComponentGetSource(), SoundComponentGetSourceData(),
  79.         SoundComponentInitOutputDevice(), SoundComponentPauseSource(),
  80.         SoundComponentPlaySourceBuffer(), SoundComponentRemoveSource(),
  81.         SoundComponentSetInfo(), SoundComponentSetOutput(), SoundComponentSetSource(),
  82.         SoundComponentStartSource(), SoundComponentStopSource(),
  83.         ParseAIFFHeader(), ParseSndHeader(), SoundConverterGetInfo(), SoundConverterSetInfo()
  84. */
  85. /*
  86.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  87.  
  88.     These items are no longer defined, but appear here so that someone
  89.     searching the interfaces might find them. If you are using one of these
  90.     items, you must change your code to support the Sound Manager.
  91.  
  92.         swMode, ftMode, ffMode
  93.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  94.         SndCompletionProcPtr
  95.         StartSound, StopSound, SoundDone
  96. */
  97. /*
  98.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  99.    constants
  100.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  101. */
  102. #define twelfthRootTwo 1.05946309435
  103.  
  104.  
  105. enum {
  106.     soundListRsrc                = FOUR_CHAR_CODE('snd ')        /*Resource type used by Sound Manager*/
  107. };
  108.  
  109.  
  110. enum {
  111.     kSimpleBeepID                = 1                                /*reserved resource ID for Simple Beep*/
  112. };
  113.  
  114.  
  115. enum {
  116.     rate48khz                    = (long)0xBB800000,                /*48000.00000 in fixed-point*/
  117.     rate44khz                    = (long)0xAC440000,                /*44100.00000 in fixed-point*/
  118.     rate22050hz                    = 0x56220000,                    /*22050.00000 in fixed-point*/
  119.     rate22khz                    = 0x56EE8BA3,                    /*22254.54545 in fixed-point*/
  120.     rate11khz                    = 0x2B7745D1,                    /*11127.27273 in fixed-point*/
  121.     rate11025hz                    = 0x2B110000                    /*11025.00000 in fixed-point*/
  122. };
  123.  
  124.  
  125. enum {
  126.                                                                 /*synthesizer numbers for SndNewChannel*/
  127.     squareWaveSynth                = 1,                            /*square wave synthesizer*/
  128.     waveTableSynth                = 3,                            /*wave table synthesizer*/
  129.     sampledSynth                = 5,                            /*sampled sound synthesizer*/
  130.                                                                 /*old Sound Manager MACE synthesizer numbers*/
  131.     MACE3snthID                    = 11,
  132.     MACE6snthID                    = 13
  133. };
  134.  
  135.  
  136. enum {
  137.     kMiddleC                    = 60                            /*MIDI note value for middle C*/
  138. };
  139.  
  140.  
  141. enum {
  142.     kNoVolume                    = 0,                            /*setting for no sound volume*/
  143.     kFullVolume                    = 0x0100                        /*1.0, setting for full hardware output volume*/
  144. };
  145.  
  146.  
  147. enum {
  148.     stdQLength                    = 128
  149. };
  150.  
  151.  
  152. enum {
  153.     dataOffsetFlag                = 0x8000
  154. };
  155.  
  156.  
  157. enum {
  158.     kUseOptionalOutputDevice    = -1                            /*only for Sound Manager 3.0 or later*/
  159. };
  160.  
  161.  
  162. enum {
  163.     notCompressed                = 0,                            /*compression ID's*/
  164.     fixedCompression            = -1,                            /*compression ID for fixed-sized compression*/
  165.     variableCompression            = -2                            /*compression ID for variable-sized compression*/
  166. };
  167.  
  168.  
  169. enum {
  170.     twoToOne                    = 1,
  171.     eightToThree                = 2,
  172.     threeToOne                    = 3,
  173.     sixToOne                    = 4,
  174.     sixToOnePacketSize            = 8,
  175.     threeToOnePacketSize        = 16
  176. };
  177.  
  178.  
  179. enum {
  180.     stateBlockSize                = 64,
  181.     leftOverBlockSize            = 32
  182. };
  183.  
  184.  
  185. enum {
  186.     firstSoundFormat            = 0x0001,                        /*general sound format*/
  187.     secondSoundFormat            = 0x0002                        /*special sampled sound format (HyperCard)*/
  188. };
  189.  
  190.  
  191. enum {
  192.     dbBufferReady                = 0x00000001,                    /*double buffer is filled*/
  193.     dbLastBuffer                = 0x00000004                    /*last double buffer to play*/
  194. };
  195.  
  196.  
  197. enum {
  198.     sysBeepDisable                = 0x0000,                        /*SysBeep() enable flags*/
  199.     sysBeepEnable                = (1 << 0),
  200.     sysBeepSynchronous            = (1 << 1)                        /*if bit set, make alert sounds synchronous*/
  201. };
  202.  
  203.  
  204. enum {
  205.     unitTypeNoSelection            = 0xFFFF,                        /*unitTypes for AudioSelection.unitType*/
  206.     unitTypeSeconds                = 0x0000
  207. };
  208.  
  209.  
  210. enum {
  211.     stdSH                        = 0x00,                            /*Standard sound header encode value*/
  212.     extSH                        = 0xFF,                            /*Extended sound header encode value*/
  213.     cmpSH                        = 0xFE                            /*Compressed sound header encode value*/
  214. };
  215.  
  216. /*command numbers for SndDoCommand and SndDoImmediate*/
  217.  
  218. enum {
  219.     nullCmd                        = 0,
  220.     initCmd                        = 1,
  221.     freeCmd                        = 2,
  222.     quietCmd                    = 3,
  223.     flushCmd                    = 4,
  224.     reInitCmd                    = 5,
  225.     waitCmd                        = 10,
  226.     pauseCmd                    = 11,
  227.     resumeCmd                    = 12,
  228.     callBackCmd                    = 13,
  229.     syncCmd                        = 14,
  230.     availableCmd                = 24,
  231.     versionCmd                    = 25,
  232.     totalLoadCmd                = 26,
  233.     loadCmd                        = 27,
  234.     freqDurationCmd                = 40,
  235.     restCmd                        = 41,
  236.     freqCmd                        = 42,
  237.     ampCmd                        = 43,
  238.     timbreCmd                    = 44,
  239.     getAmpCmd                    = 45,
  240.     volumeCmd                    = 46,                            /*sound manager 3.0 or later only*/
  241.     getVolumeCmd                = 47,                            /*sound manager 3.0 or later only*/
  242.     clockComponentCmd            = 50,                            /*sound manager 3.2.1 or later only*/
  243.     getClockComponentCmd        = 51,                            /*sound manager 3.2.1 or later only*/
  244.     scheduledSoundCmd            = 52,                            /*sound manager 3.3 or later only*/
  245.     linkSoundComponentsCmd        = 53,                            /*sound manager 3.3 or later only*/
  246.     waveTableCmd                = 60,
  247.     phaseCmd                    = 61,
  248.     soundCmd                    = 80,
  249.     bufferCmd                    = 81,
  250.     rateCmd                        = 82,
  251.     continueCmd                    = 83,
  252.     doubleBufferCmd                = 84,
  253.     getRateCmd                    = 85,
  254.     rateMultiplierCmd            = 86,
  255.     getRateMultiplierCmd        = 87,
  256.     sizeCmd                        = 90,                            /*obsolete command*/
  257.     convertCmd                    = 91                            /*obsolete MACE command*/
  258. };
  259.  
  260. #if OLDROUTINENAMES
  261. /*channel initialization parameters*/
  262.  
  263. enum {
  264.     waveInitChannelMask            = 0x07,
  265.     waveInitChannel0            = 0x04,                            /*wave table only, Sound Manager 2.0 and earlier*/
  266.     waveInitChannel1            = 0x05,                            /*wave table only, Sound Manager 2.0 and earlier*/
  267.     waveInitChannel2            = 0x06,                            /*wave table only, Sound Manager 2.0 and earlier*/
  268.     waveInitChannel3            = 0x07,                            /*wave table only, Sound Manager 2.0 and earlier*/
  269.     initChan0                    = waveInitChannel0,                /*obsolete spelling*/
  270.     initChan1                    = waveInitChannel1,                /*obsolete spelling*/
  271.     initChan2                    = waveInitChannel2,                /*obsolete spelling*/
  272.     initChan3                    = waveInitChannel3                /*obsolete spelling*/
  273. };
  274.  
  275.  
  276. enum {
  277.     outsideCmpSH                = 0,                            /*obsolete MACE constant*/
  278.     insideCmpSH                    = 1,                            /*obsolete MACE constant*/
  279.     aceSuccess                    = 0,                            /*obsolete MACE constant*/
  280.     aceMemFull                    = 1,                            /*obsolete MACE constant*/
  281.     aceNilBlock                    = 2,                            /*obsolete MACE constant*/
  282.     aceBadComp                    = 3,                            /*obsolete MACE constant*/
  283.     aceBadEncode                = 4,                            /*obsolete MACE constant*/
  284.     aceBadDest                    = 5,                            /*obsolete MACE constant*/
  285.     aceBadCmd                    = 6                                /*obsolete MACE constant*/
  286. };
  287.  
  288. #endif  /* OLDROUTINENAMES */
  289.  
  290.  
  291. enum {
  292.     initChanLeft                = 0x0002,                        /*left stereo channel*/
  293.     initChanRight                = 0x0003,                        /*right stereo channel*/
  294.     initNoInterp                = 0x0004,                        /*no linear interpolation*/
  295.     initNoDrop                    = 0x0008,                        /*no drop-sample conversion*/
  296.     initMono                    = 0x0080,                        /*monophonic channel*/
  297.     initStereo                    = 0x00C0,                        /*stereo channel*/
  298.     initMACE3                    = 0x0300,                        /*MACE 3:1*/
  299.     initMACE6                    = 0x0400,                        /*MACE 6:1*/
  300.     initPanMask                    = 0x0003,                        /*mask for right/left pan values*/
  301.     initSRateMask                = 0x0030,                        /*mask for sample rate values*/
  302.     initStereoMask                = 0x00C0,                        /*mask for mono/stereo values*/
  303.     initCompMask                = 0xFF00                        /*mask for compression IDs*/
  304. };
  305.  
  306. /*Get&Set Sound Information Selectors*/
  307.  
  308. enum {
  309.     siActiveChannels            = FOUR_CHAR_CODE('chac'),        /*active channels*/
  310.     siActiveLevels                = FOUR_CHAR_CODE('lmac'),        /*active meter levels*/
  311.     siAGCOnOff                    = FOUR_CHAR_CODE('agc '),        /*automatic gain control state*/
  312.     siAsync                        = FOUR_CHAR_CODE('asyn'),        /*asynchronous capability*/
  313.     siAVDisplayBehavior            = FOUR_CHAR_CODE('avdb'),
  314.     siChannelAvailable            = FOUR_CHAR_CODE('chav'),        /*number of channels available*/
  315.     siCompressionAvailable        = FOUR_CHAR_CODE('cmav'),        /*compression types available*/
  316.     siCompressionChannels        = FOUR_CHAR_CODE('cpct'),        /*compressor's number of channels*/
  317.     siCompressionFactor            = FOUR_CHAR_CODE('cmfa'),        /*current compression factor*/
  318.     siCompressionHeader            = FOUR_CHAR_CODE('cmhd'),        /*return compression header*/
  319.     siCompressionNames            = FOUR_CHAR_CODE('cnam'),        /*compression type names available*/
  320.     siCompressionParams            = FOUR_CHAR_CODE('evaw'),        /*compression parameters*/
  321.     siCompressionSampleRate        = FOUR_CHAR_CODE('cprt'),        /*compressor's sample rate*/
  322.     siCompressionType            = FOUR_CHAR_CODE('comp'),        /*current compression type*/
  323.     siContinuous                = FOUR_CHAR_CODE('cont'),        /*continous recording*/
  324.     siDecompressionParams        = FOUR_CHAR_CODE('wave'),        /*decompression parameters*/
  325.     siDeviceBufferInfo            = FOUR_CHAR_CODE('dbin'),        /*size of interrupt buffer*/
  326.     siDeviceConnected            = FOUR_CHAR_CODE('dcon'),        /*input device connection status*/
  327.     siDeviceIcon                = FOUR_CHAR_CODE('icon'),        /*input device icon*/
  328.     siDeviceName                = FOUR_CHAR_CODE('name'),        /*input device name*/
  329.     siHardwareBalance            = FOUR_CHAR_CODE('hbal'),
  330.     siHardwareBalanceSteps        = FOUR_CHAR_CODE('hbls'),
  331.     siHardwareBass                = FOUR_CHAR_CODE('hbas'),
  332.     siHardwareBassSteps            = FOUR_CHAR_CODE('hbst'),
  333.     siHardwareBusy                = FOUR_CHAR_CODE('hwbs'),        /*sound hardware is in use*/
  334.     siHardwareFormat            = FOUR_CHAR_CODE('hwfm'),        /*get hardware format*/
  335.     siHardwareMute                = FOUR_CHAR_CODE('hmut'),        /*mute state of all hardware*/
  336.     siHardwareTreble            = FOUR_CHAR_CODE('htrb'),
  337.     siHardwareTrebleSteps        = FOUR_CHAR_CODE('hwts'),
  338.     siHardwareVolume            = FOUR_CHAR_CODE('hvol'),        /*volume level of all hardware*/
  339.     siHardwareVolumeSteps        = FOUR_CHAR_CODE('hstp'),        /*number of volume steps for hardware*/
  340.     siHeadphoneMute                = FOUR_CHAR_CODE('pmut'),        /*mute state of headphones*/
  341.     siHeadphoneVolume            = FOUR_CHAR_CODE('pvol'),        /*volume level of headphones*/
  342.     siHeadphoneVolumeSteps        = FOUR_CHAR_CODE('hdst'),        /*number of volume steps for headphones*/
  343.     siInputAvailable            = FOUR_CHAR_CODE('inav'),        /*input sources available*/
  344.     siInputGain                    = FOUR_CHAR_CODE('gain'),        /*input gain*/
  345.     siInputSource                = FOUR_CHAR_CODE('sour'),        /*input source selector*/
  346.     siInputSourceNames            = FOUR_CHAR_CODE('snam'),        /*input source names*/
  347.     siLevelMeterOnOff            = FOUR_CHAR_CODE('lmet'),        /*level meter state*/
  348.     siModemGain                    = FOUR_CHAR_CODE('mgai'),        /*modem input gain*/
  349.     siMonitorAvailable            = FOUR_CHAR_CODE('mnav'),
  350.     siMonitorSource                = FOUR_CHAR_CODE('mons'),
  351.     siNumberChannels            = FOUR_CHAR_CODE('chan'),        /*current number of channels*/
  352.     siOptionsDialog                = FOUR_CHAR_CODE('optd'),        /*display options dialog*/
  353.     siOSTypeInputSource            = FOUR_CHAR_CODE('inpt'),        /*input source by OSType*/
  354.     siOSTypeInputAvailable        = FOUR_CHAR_CODE('inav'),        /*list of available input source OSTypes*/
  355.     siPlayThruOnOff                = FOUR_CHAR_CODE('plth'),        /*playthrough state*/
  356.     siPostMixerSoundComponent    = FOUR_CHAR_CODE('psmx'),        /*install post-mixer effect*/
  357.     siPreMixerSoundComponent    = FOUR_CHAR_CODE('prmx'),        /*install pre-mixer effect*/
  358.     siQuality                    = FOUR_CHAR_CODE('qual'),        /*quality setting*/
  359.     siRateMultiplier            = FOUR_CHAR_CODE('rmul'),        /*throttle rate setting*/
  360.     siRecordingQuality            = FOUR_CHAR_CODE('qual'),        /*recording quality*/
  361.     siSampleRate                = FOUR_CHAR_CODE('srat'),        /*current sample rate*/
  362.     siSampleRateAvailable        = FOUR_CHAR_CODE('srav'),        /*sample rates available*/
  363.     siSampleSize                = FOUR_CHAR_CODE('ssiz'),        /*current sample size*/
  364.     siSampleSizeAvailable        = FOUR_CHAR_CODE('ssav'),        /*sample sizes available*/
  365.     siSetupCDAudio                = FOUR_CHAR_CODE('sucd'),        /*setup sound hardware for CD audio*/
  366.     siSetupModemAudio            = FOUR_CHAR_CODE('sumd'),        /*setup sound hardware for modem audio*/
  367.     siSlopeAndIntercept            = FOUR_CHAR_CODE('flap'),        /*floating point variables for conversion*/
  368.     siSoundClock                = FOUR_CHAR_CODE('sclk'),
  369.     siUseThisSoundClock            = FOUR_CHAR_CODE('sclc'),        /*sdev uses this to tell the mixer to use his sound clock*/
  370.     siSpeakerMute                = FOUR_CHAR_CODE('smut'),        /*mute state of all built-in speaker*/
  371.     siSpeakerVolume                = FOUR_CHAR_CODE('svol'),        /*volume level of built-in speaker*/
  372.     siSSpCPULoadLimit            = FOUR_CHAR_CODE('3dll'),
  373.     siSSpLocalization            = FOUR_CHAR_CODE('3dif'),
  374.     siSSpSpeakerSetup            = FOUR_CHAR_CODE('3dst'),
  375.     siStereoInputGain            = FOUR_CHAR_CODE('sgai'),        /*stereo input gain*/
  376.     siSubwooferMute                = FOUR_CHAR_CODE('bmut'),        /*mute state of sub-woofer*/
  377.     siTwosComplementOnOff        = FOUR_CHAR_CODE('twos'),        /*two's complement state*/
  378.     siVolume                    = FOUR_CHAR_CODE('volu'),        /*volume level of source*/
  379.     siVoxRecordInfo                = FOUR_CHAR_CODE('voxr'),        /*VOX record parameters*/
  380.     siVoxStopInfo                = FOUR_CHAR_CODE('voxs'),        /*VOX stop parameters*/
  381.     siWideStereo                = FOUR_CHAR_CODE('wide')        /*wide stereo setting*/
  382. };
  383.  
  384.  
  385. enum {
  386.     siCloseDriver                = FOUR_CHAR_CODE('clos'),        /*reserved for internal use only*/
  387.     siInitializeDriver            = FOUR_CHAR_CODE('init'),        /*reserved for internal use only*/
  388.     siPauseRecording            = FOUR_CHAR_CODE('paus'),        /*reserved for internal use only*/
  389.     siUserInterruptProc            = FOUR_CHAR_CODE('user')        /*reserved for internal use only*/
  390. };
  391.  
  392. /* input source Types*/
  393.  
  394. enum {
  395.     kInvalidSource                = (long)0xFFFFFFFF,                /*this source may be returned from GetInfo if no other source is the monitored source*/
  396.     kNoSource                    = FOUR_CHAR_CODE('none'),        /*no source selection*/
  397.     kCDSource                    = FOUR_CHAR_CODE('cd  '),        /*internal CD player input*/
  398.     kExtMicSource                = FOUR_CHAR_CODE('emic'),        /*external mic input*/
  399.     kSoundInSource                = FOUR_CHAR_CODE('sinj'),        /*sound input jack*/
  400.     kRCAInSource                = FOUR_CHAR_CODE('irca'),        /*RCA jack input*/
  401.     kTVFMTunerSource            = FOUR_CHAR_CODE('tvfm'),
  402.     kDAVInSource                = FOUR_CHAR_CODE('idav'),        /*DAV analog input*/
  403.     kIntMicSource                = FOUR_CHAR_CODE('imic'),        /*internal mic input*/
  404.     kMediaBaySource                = FOUR_CHAR_CODE('mbay'),        /*media bay input*/
  405.     kModemSource                = FOUR_CHAR_CODE('modm'),        /*modem input (internal modem on desktops, PCI input on PowerBooks)*/
  406.     kPCCardSource                = FOUR_CHAR_CODE('pcm '),        /*PC Card pwm input*/
  407.     kZoomVideoSource            = FOUR_CHAR_CODE('zvpc'),        /*zoom video input*/
  408.     kDVDSource                    = FOUR_CHAR_CODE('dvda')        /*DVD audio input*/
  409. };
  410.  
  411. /*Sound Component Types and Subtypes*/
  412.  
  413. enum {
  414.     kNoSoundComponentType        = FOUR_CHAR_CODE('****'),
  415.     kSoundComponentType            = FOUR_CHAR_CODE('sift'),        /*component type*/
  416.     kSoundComponentPPCType        = FOUR_CHAR_CODE('nift'),        /*component type for PowerPC code*/
  417.     kRate8SubType                = FOUR_CHAR_CODE('ratb'),        /*8-bit rate converter*/
  418.     kRate16SubType                = FOUR_CHAR_CODE('ratw'),        /*16-bit rate converter*/
  419.     kConverterSubType            = FOUR_CHAR_CODE('conv'),        /*sample format converter*/
  420.     kSndSourceSubType            = FOUR_CHAR_CODE('sour'),        /*generic source component*/
  421.     kMixerType                    = FOUR_CHAR_CODE('mixr'),
  422.     kMixer8SubType                = FOUR_CHAR_CODE('mixb'),        /*8-bit mixer*/
  423.     kMixer16SubType                = FOUR_CHAR_CODE('mixw'),        /*16-bit mixer*/
  424.     kSoundInputDeviceType        = FOUR_CHAR_CODE('sinp'),        /*sound input component*/
  425.     kWaveInSubType                = FOUR_CHAR_CODE('wavi'),        /*Windows Wave*/
  426.     kSoundOutputDeviceType        = FOUR_CHAR_CODE('sdev'),        /*sound output component*/
  427.     kClassicSubType                = FOUR_CHAR_CODE('clas'),        /*classic hardware, i.e. Mac Plus*/
  428.     kASCSubType                    = FOUR_CHAR_CODE('asc '),        /*Apple Sound Chip device*/
  429.     kDSPSubType                    = FOUR_CHAR_CODE('dsp '),        /*DSP device*/
  430.     kAwacsSubType                = FOUR_CHAR_CODE('awac'),        /*Another of Will's Audio Chips device*/
  431.     kGCAwacsSubType                = FOUR_CHAR_CODE('awgc'),        /*Awacs audio with Grand Central DMA*/
  432.     kSingerSubType                = FOUR_CHAR_CODE('sing'),        /*Singer (via Whitney) based sound*/
  433.     kSinger2SubType                = FOUR_CHAR_CODE('sng2'),        /*Singer 2 (via Whitney) for Acme*/
  434.     kWhitSubType                = FOUR_CHAR_CODE('whit'),        /*Whit sound component for PrimeTime 3*/
  435.     kSoundBlasterSubType        = FOUR_CHAR_CODE('sbls'),        /*Sound Blaster for CHRP*/
  436.     kWaveOutSubType                = FOUR_CHAR_CODE('wavo'),        /*Windows Wave*/
  437.     kDirectSoundSubType            = FOUR_CHAR_CODE('dsnd'),        /*Direct Sound*/
  438.     kUNIXsdevSubType            = FOUR_CHAR_CODE('un1x'),        /*UNIX base sdev*/
  439.     kSoundCompressor            = FOUR_CHAR_CODE('scom'),
  440.     kSoundDecompressor            = FOUR_CHAR_CODE('sdec'),
  441.     kAudioComponentType            = FOUR_CHAR_CODE('adio'),        /*Audio components and sub-types*/
  442.     kAwacsPhoneSubType            = FOUR_CHAR_CODE('hphn'),
  443.     kAudioVisionSpeakerSubType    = FOUR_CHAR_CODE('telc'),
  444.     kAudioVisionHeadphoneSubType = FOUR_CHAR_CODE('telh'),
  445.     kPhilipsFaderSubType        = FOUR_CHAR_CODE('tvav'),
  446.     kSGSToneSubType                = FOUR_CHAR_CODE('sgs0'),
  447.     kSoundEffectsType            = FOUR_CHAR_CODE('snfx'),        /*sound effects type*/
  448.     kSSpLocalizationSubType        = FOUR_CHAR_CODE('snd3')
  449. };
  450.  
  451. /*Format Types*/
  452.  
  453. enum {
  454.     kSoundNotCompressed            = FOUR_CHAR_CODE('NONE'),        /*sound is not compressed*/
  455.     k8BitOffsetBinaryFormat        = FOUR_CHAR_CODE('raw '),        /*8-bit offset binary*/
  456.     k16BitBigEndianFormat        = FOUR_CHAR_CODE('twos'),        /*16-bit big endian*/
  457.     k16BitLittleEndianFormat    = FOUR_CHAR_CODE('sowt'),        /*16-bit little endian*/
  458.     kFloat32Format                = FOUR_CHAR_CODE('fl32'),        /*32-bit floating point*/
  459.     kFloat64Format                = FOUR_CHAR_CODE('fl64'),        /*64-bit floating point*/
  460.     k24BitFormat                = FOUR_CHAR_CODE('in24'),        /*24-bit integer*/
  461.     k32BitFormat                = FOUR_CHAR_CODE('in32'),        /*32-bit integer*/
  462.     kMACE3Compression            = FOUR_CHAR_CODE('MAC3'),        /*MACE 3:1*/
  463.     kMACE6Compression            = FOUR_CHAR_CODE('MAC6'),        /*MACE 6:1*/
  464.     kCDXA4Compression            = FOUR_CHAR_CODE('cdx4'),        /*CD/XA 4:1*/
  465.     kCDXA2Compression            = FOUR_CHAR_CODE('cdx2'),        /*CD/XA 2:1*/
  466.     kIMACompression                = FOUR_CHAR_CODE('ima4'),        /*IMA 4:1*/
  467.     kULawCompression            = FOUR_CHAR_CODE('ulaw'),        /*µLaw 2:1*/
  468.     kALawCompression            = FOUR_CHAR_CODE('alaw'),        /*aLaw 2:1*/
  469.     kMicrosoftADPCMFormat        = 0x6D730002,                    /*Microsoft ADPCM - ACM code 2*/
  470.     kDVIIntelIMAFormat            = 0x6D730011,                    /*DVI/Intel IMA ADPCM - ACM code 17*/
  471.     kDVAudioFormat                = FOUR_CHAR_CODE('dvca'),        /*DV Audio*/
  472.     kQDesignCompression            = FOUR_CHAR_CODE('QDMC'),        /*QDesign music*/
  473.     kQUALCOMMCompression        = FOUR_CHAR_CODE('Qclp'),        /*QUALCOMM PureVoice*/
  474.     kOffsetBinary                = k8BitOffsetBinaryFormat,        /*for compatibility*/
  475.     kTwosComplement                = k16BitBigEndianFormat,        /*for compatibility*/
  476.     kLittleEndianFormat            = k16BitLittleEndianFormat        /*for compatibility*/
  477. };
  478.  
  479. #if TARGET_RT_LITTLE_ENDIAN
  480.  
  481. enum {
  482.     k16BitNativeEndianFormat    = k16BitLittleEndianFormat,
  483.     k16BitNonNativeEndianFormat    = k16BitBigEndianFormat
  484. };
  485.  
  486. #else
  487.  
  488. enum {
  489.     k16BitNativeEndianFormat    = k16BitBigEndianFormat,
  490.     k16BitNonNativeEndianFormat    = k16BitLittleEndianFormat
  491. };
  492.  
  493. #endif  /* TARGET_RT_LITTLE_ENDIAN */
  494.  
  495. /*Features Flags*/
  496.  
  497. enum {
  498.     k8BitRawIn                    = (1 << 0),                        /*data description*/
  499.     k8BitTwosIn                    = (1 << 1),
  500.     k16BitIn                    = (1 << 2),
  501.     kStereoIn                    = (1 << 3),
  502.     k8BitRawOut                    = (1 << 8),
  503.     k8BitTwosOut                = (1 << 9),
  504.     k16BitOut                    = (1 << 10),
  505.     kStereoOut                    = (1 << 11),
  506.     kReverse                    = (1L << 16),                    /*  function description*/
  507.     kRateConvert                = (1L << 17),
  508.     kCreateSoundSource            = (1L << 18),
  509.     kHighQuality                = (1L << 22),                    /*  performance description*/
  510.     kNonRealTime                = (1L << 23)
  511. };
  512.  
  513. /*SoundComponentPlaySourceBuffer action flags*/
  514.  
  515. enum {
  516.     kSourcePaused                = (1 << 0),
  517.     kPassThrough                = (1L << 16),
  518.     kNoSoundComponentChain        = (1L << 17)
  519. };
  520.  
  521. /*SoundParamBlock flags, usefull for OpenMixerSoundComponent*/
  522.  
  523. enum {
  524.     kNoMixing                    = (1 << 0),                        /*don't mix source*/
  525.     kNoSampleRateConversion        = (1 << 1),                        /*don't convert sample rate (i.e. 11 kHz -> 22 kHz)*/
  526.     kNoSampleSizeConversion        = (1 << 2),                        /*don't convert sample size (i.e. 16 -> 8)*/
  527.     kNoSampleFormatConversion    = (1 << 3),                        /*don't convert sample format (i.e. 'twos' -> 'raw ')*/
  528.     kNoChannelConversion        = (1 << 4),                        /*don't convert stereo/mono*/
  529.     kNoDecompression            = (1 << 5),                        /*don't decompress (i.e. 'MAC3' -> 'raw ')*/
  530.     kNoVolumeConversion            = (1 << 6),                        /*don't apply volume*/
  531.     kNoRealtimeProcessing        = (1 << 7),                        /*won't run at interrupt time*/
  532.     kScheduledSource            = (1 << 8)                        /*source is scheduled*/
  533. };
  534.  
  535. /*SoundParamBlock quality settings*/
  536.  
  537. enum {
  538.     kBestQuality                = (1 << 0)                        /*use interpolation in rate conversion*/
  539. };
  540.  
  541. /*useful bit masks*/
  542.  
  543. enum {
  544.     kInputMask                    = 0x000000FF,                    /*masks off input bits*/
  545.     kOutputMask                    = 0x0000FF00,                    /*masks off output bits*/
  546.     kOutputShift                = 8,                            /*amount output bits are shifted*/
  547.     kActionMask                    = 0x00FF0000,                    /*masks off action bits*/
  548.     kSoundComponentBits            = 0x00FFFFFF
  549. };
  550.  
  551. /*audio atom types*/
  552.  
  553. enum {
  554.     kAudioFormatAtomType        = FOUR_CHAR_CODE('frma'),
  555.     kAudioEndianAtomType        = FOUR_CHAR_CODE('enda'),
  556.     kAudioTerminatorAtomType    = 0
  557. };
  558.  
  559. /*siAVDisplayBehavior types*/
  560.  
  561. enum {
  562.     kAVDisplayHeadphoneRemove    = 0,                            /* monitor does not have a headphone attached*/
  563.     kAVDisplayHeadphoneInsert    = 1,                            /* monitor has a headphone attached*/
  564.     kAVDisplayPlainTalkRemove    = 2,                            /* monitor either sending no input through CPU input port or unable to tell if input is coming in*/
  565.     kAVDisplayPlainTalkInsert    = 3                                /* monitor sending PlainTalk level microphone source input through sound input port*/
  566. };
  567.  
  568. /*Audio Component constants*/
  569.  
  570. enum {
  571.                                                                 /*Values for whichChannel parameter*/
  572.     audioAllChannels            = 0,                            /*All channels (usually interpreted as both left and right)*/
  573.     audioLeftChannel            = 1,                            /*Left channel*/
  574.     audioRightChannel            = 2,                            /*Right channel*/
  575.                                                                 /*Values for mute parameter*/
  576.     audioUnmuted                = 0,                            /*Device is unmuted*/
  577.     audioMuted                    = 1,                            /*Device is muted*/
  578.                                                                 /*Capabilities flags definitions*/
  579.     audioDoesMono                = (1L << 0),                    /*Device supports mono output*/
  580.     audioDoesStereo                = (1L << 1),                    /*Device supports stereo output*/
  581.     audioDoesIndependentChannels = (1L << 2)                    /*Device supports independent software control of each channel*/
  582. };
  583.  
  584. /*Sound Input Qualities*/
  585.  
  586. enum {
  587.     siCDQuality                    = FOUR_CHAR_CODE('cd  '),        /*44.1kHz, stereo, 16 bit*/
  588.     siBestQuality                = FOUR_CHAR_CODE('best'),        /*22kHz, mono, 8 bit*/
  589.     siBetterQuality                = FOUR_CHAR_CODE('betr'),        /*22kHz, mono, MACE 3:1*/
  590.     siGoodQuality                = FOUR_CHAR_CODE('good'),        /*22kHz, mono, MACE 6:1*/
  591.     siNoneQuality                = FOUR_CHAR_CODE('none')        /*settings don't match any quality for a get call*/
  592. };
  593.  
  594.  
  595. enum {
  596.     siDeviceIsConnected            = 1,                            /*input device is connected and ready for input*/
  597.     siDeviceNotConnected        = 0,                            /*input device is not connected*/
  598.     siDontKnowIfConnected        = -1,                            /*can't tell if input device is connected*/
  599.     siReadPermission            = 0,                            /*permission passed to SPBOpenDevice*/
  600.     siWritePermission            = 1                                /*permission passed to SPBOpenDevice*/
  601. };
  602.  
  603. /*
  604.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  605.    typedefs
  606.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  607. */
  608.  
  609.  
  610. struct SndCommand {
  611.     unsigned short                     cmd;
  612.     short                             param1;
  613.     long                             param2;
  614. };
  615. typedef struct SndCommand                SndCommand;
  616. typedef struct SndChannel                 SndChannel;
  617.  
  618. typedef SndChannel *                    SndChannelPtr;
  619. typedef CALLBACK_API( void , SndCallBackProcPtr )(SndChannelPtr chan, SndCommand *cmd);
  620. typedef STACK_UPP_TYPE(SndCallBackProcPtr)                         SndCallBackUPP;
  621.  
  622. struct SndChannel {
  623.     SndChannelPtr                     nextChan;
  624.     Ptr                             firstMod;                    /* reserved for the Sound Manager */
  625.     SndCallBackUPP                     callBack;
  626.     long                             userInfo;
  627.     long                             wait;                        /* The following is for internal Sound Manager use only.*/
  628.     SndCommand                         cmdInProgress;
  629.     short                             flags;
  630.     short                             qLength;
  631.     short                             qHead;
  632.     short                             qTail;
  633.     SndCommand                         queue[128];
  634. };
  635.  
  636. /*MACE structures*/
  637.  
  638. struct StateBlock {
  639.     short                             stateVar[64];
  640. };
  641. typedef struct StateBlock                StateBlock;
  642. typedef StateBlock *                    StateBlockPtr;
  643.  
  644. struct LeftOverBlock {
  645.     unsigned long                     count;
  646.     SInt8                             sampleArea[32];
  647. };
  648. typedef struct LeftOverBlock            LeftOverBlock;
  649. typedef LeftOverBlock *                    LeftOverBlockPtr;
  650.  
  651. struct ModRef {
  652.     unsigned short                     modNumber;
  653.     long                             modInit;
  654. };
  655. typedef struct ModRef                    ModRef;
  656.  
  657. struct SndListResource {
  658.     short                             format;
  659.     short                             numModifiers;
  660.     ModRef                             modifierPart[1];
  661.     short                             numCommands;
  662.     SndCommand                         commandPart[1];
  663.     UInt8                             dataPart[1];
  664. };
  665. typedef struct SndListResource            SndListResource;
  666.  
  667. typedef SndListResource *                SndListPtr;
  668. typedef SndListPtr *                    SndListHandle;
  669. typedef SndListHandle                     SndListHndl;
  670. /*HyperCard sound resource format*/
  671.  
  672. struct Snd2ListResource {
  673.     short                             format;
  674.     short                             refCount;
  675.     short                             numCommands;
  676.     SndCommand                         commandPart[1];
  677.     UInt8                             dataPart[1];
  678. };
  679. typedef struct Snd2ListResource            Snd2ListResource;
  680.  
  681. typedef Snd2ListResource *                Snd2ListPtr;
  682. typedef Snd2ListPtr *                    Snd2ListHandle;
  683. typedef Snd2ListHandle                     Snd2ListHndl;
  684.  
  685. struct SoundHeader {
  686.     Ptr                             samplePtr;                    /*if NIL then samples are in sampleArea*/
  687.     unsigned long                     length;                        /*length of sound in bytes*/
  688.     UnsignedFixed                     sampleRate;                    /*sample rate for this sound*/
  689.     unsigned long                     loopStart;                    /*start of looping portion*/
  690.     unsigned long                     loopEnd;                    /*end of looping portion*/
  691.     UInt8                             encode;                        /*header encoding*/
  692.     UInt8                             baseFrequency;                /*baseFrequency value*/
  693.     UInt8                             sampleArea[1];                /*space for when samples follow directly*/
  694. };
  695. typedef struct SoundHeader                SoundHeader;
  696. typedef SoundHeader *                    SoundHeaderPtr;
  697.  
  698. struct CmpSoundHeader {
  699.     Ptr                             samplePtr;                    /*if nil then samples are in sample area*/
  700.     unsigned long                     numChannels;                /*number of channels i.e. mono = 1*/
  701.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  702.     unsigned long                     loopStart;                    /*loopStart of sound before compression*/
  703.     unsigned long                     loopEnd;                    /*loopEnd of sound before compression*/
  704.     UInt8                             encode;                        /*data structure used , stdSH, extSH, or cmpSH*/
  705.     UInt8                             baseFrequency;                /*same meaning as regular SoundHeader*/
  706.     unsigned long                     numFrames;                    /*length in frames ( packetFrames or sampleFrames )*/
  707.     extended80                         AIFFSampleRate;                /*IEEE sample rate*/
  708.     Ptr                             markerChunk;                /*sync track*/
  709.     OSType                             format;                        /*data format type, was futureUse1*/
  710.     unsigned long                     futureUse2;                    /*reserved by Apple*/
  711.     StateBlockPtr                     stateVars;                    /*pointer to State Block*/
  712.     LeftOverBlockPtr                 leftOverSamples;            /*used to save truncated samples between compression calls*/
  713.     short                             compressionID;                /*0 means no compression, non zero means compressionID*/
  714.     unsigned short                     packetSize;                    /*number of bits in compressed sample packet*/
  715.     unsigned short                     snthID;                        /*resource ID of Sound Manager snth that contains NRT C/E*/
  716.     unsigned short                     sampleSize;                    /*number of bits in non-compressed sample*/
  717.     UInt8                             sampleArea[1];                /*space for when samples follow directly*/
  718. };
  719. typedef struct CmpSoundHeader            CmpSoundHeader;
  720. typedef CmpSoundHeader *                CmpSoundHeaderPtr;
  721.  
  722. struct ExtSoundHeader {
  723.     Ptr                             samplePtr;                    /*if nil then samples are in sample area*/
  724.     unsigned long                     numChannels;                /*number of channels,  ie mono = 1*/
  725.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  726.     unsigned long                     loopStart;                    /*same meaning as regular SoundHeader*/
  727.     unsigned long                     loopEnd;                    /*same meaning as regular SoundHeader*/
  728.     UInt8                             encode;                        /*data structure used , stdSH, extSH, or cmpSH*/
  729.     UInt8                             baseFrequency;                /*same meaning as regular SoundHeader*/
  730.     unsigned long                     numFrames;                    /*length in total number of frames*/
  731.     extended80                         AIFFSampleRate;                /*IEEE sample rate*/
  732.     Ptr                             markerChunk;                /*sync track*/
  733.     Ptr                             instrumentChunks;            /*AIFF instrument chunks*/
  734.     Ptr                             AESRecording;
  735.     unsigned short                     sampleSize;                    /*number of bits in sample*/
  736.     unsigned short                     futureUse1;                    /*reserved by Apple*/
  737.     unsigned long                     futureUse2;                    /*reserved by Apple*/
  738.     unsigned long                     futureUse3;                    /*reserved by Apple*/
  739.     unsigned long                     futureUse4;                    /*reserved by Apple*/
  740.     UInt8                             sampleArea[1];                /*space for when samples follow directly*/
  741. };
  742. typedef struct ExtSoundHeader            ExtSoundHeader;
  743. typedef ExtSoundHeader *                ExtSoundHeaderPtr;
  744.  
  745. union SoundHeaderUnion {
  746.     SoundHeader                     stdHeader;
  747.     CmpSoundHeader                     cmpHeader;
  748.     ExtSoundHeader                     extHeader;
  749. };
  750. typedef union SoundHeaderUnion            SoundHeaderUnion;
  751.  
  752. struct ConversionBlock {
  753.     short                             destination;
  754.     short                             unused;
  755.     CmpSoundHeaderPtr                 inputPtr;
  756.     CmpSoundHeaderPtr                 outputPtr;
  757. };
  758. typedef struct ConversionBlock            ConversionBlock;
  759. typedef ConversionBlock *                ConversionBlockPtr;
  760. /* ScheduledSoundHeader flags*/
  761.  
  762. enum {
  763.     kScheduledSoundDoScheduled    = 1 << 0,
  764.     kScheduledSoundDoCallBack    = 1 << 1
  765. };
  766.  
  767.  
  768. struct ScheduledSoundHeader {
  769.     SoundHeaderUnion                 u;
  770.     long                             flags;
  771.     short                             reserved;
  772.     short                             callBackParam1;
  773.     long                             callBackParam2;
  774.     TimeRecord                         startTime;
  775. };
  776. typedef struct ScheduledSoundHeader        ScheduledSoundHeader;
  777. typedef ScheduledSoundHeader *            ScheduledSoundHeaderPtr;
  778.  
  779. struct SMStatus {
  780.     short                             smMaxCPULoad;
  781.     short                             smNumChannels;
  782.     short                             smCurCPULoad;
  783. };
  784. typedef struct SMStatus                    SMStatus;
  785. typedef SMStatus *                        SMStatusPtr;
  786.  
  787. struct SCStatus {
  788.     UnsignedFixed                     scStartTime;
  789.     UnsignedFixed                     scEndTime;
  790.     UnsignedFixed                     scCurrentTime;
  791.     Boolean                         scChannelBusy;
  792.     Boolean                         scChannelDisposed;
  793.     Boolean                         scChannelPaused;
  794.     Boolean                         scUnused;
  795.     unsigned long                     scChannelAttributes;
  796.     long                             scCPULoad;
  797. };
  798. typedef struct SCStatus                    SCStatus;
  799. typedef SCStatus *                        SCStatusPtr;
  800.  
  801. struct AudioSelection {
  802.     long                             unitType;
  803.     UnsignedFixed                     selStart;
  804.     UnsignedFixed                     selEnd;
  805. };
  806. typedef struct AudioSelection            AudioSelection;
  807. typedef AudioSelection *                AudioSelectionPtr;
  808.  
  809. struct SndDoubleBuffer {
  810.     long                             dbNumFrames;
  811.     long                             dbFlags;
  812.     long                             dbUserInfo[2];
  813.     SInt8                             dbSoundData[1];
  814. };
  815. typedef struct SndDoubleBuffer            SndDoubleBuffer;
  816. typedef SndDoubleBuffer *                SndDoubleBufferPtr;
  817.  
  818.  
  819. typedef CALLBACK_API( void , SndDoubleBackProcPtr )(SndChannelPtr channel, SndDoubleBufferPtr doubleBufferPtr);
  820. typedef STACK_UPP_TYPE(SndDoubleBackProcPtr)                     SndDoubleBackUPP;
  821.  
  822. struct SndDoubleBufferHeader {
  823.     short                             dbhNumChannels;
  824.     short                             dbhSampleSize;
  825.     short                             dbhCompressionID;
  826.     short                             dbhPacketSize;
  827.     UnsignedFixed                     dbhSampleRate;
  828.     SndDoubleBufferPtr                 dbhBufferPtr[2];
  829.     SndDoubleBackUPP                 dbhDoubleBack;
  830. };
  831. typedef struct SndDoubleBufferHeader    SndDoubleBufferHeader;
  832. typedef SndDoubleBufferHeader *            SndDoubleBufferHeaderPtr;
  833.  
  834. struct SndDoubleBufferHeader2 {
  835.     short                             dbhNumChannels;
  836.     short                             dbhSampleSize;
  837.     short                             dbhCompressionID;
  838.     short                             dbhPacketSize;
  839.     UnsignedFixed                     dbhSampleRate;
  840.     SndDoubleBufferPtr                 dbhBufferPtr[2];
  841.     SndDoubleBackUPP                 dbhDoubleBack;
  842.     OSType                             dbhFormat;
  843. };
  844. typedef struct SndDoubleBufferHeader2    SndDoubleBufferHeader2;
  845. typedef SndDoubleBufferHeader2 *        SndDoubleBufferHeader2Ptr;
  846.  
  847. struct SoundInfoList {
  848.     short                             count;
  849.     Handle                             infoHandle;
  850. };
  851. typedef struct SoundInfoList            SoundInfoList;
  852. typedef SoundInfoList *                    SoundInfoListPtr;
  853.  
  854. struct SoundComponentData {
  855.     long                             flags;
  856.     OSType                             format;
  857.     short                             numChannels;
  858.     short                             sampleSize;
  859.     UnsignedFixed                     sampleRate;
  860.     long                             sampleCount;
  861.     Byte *                            buffer;
  862.     long                             reserved;
  863. };
  864. typedef struct SoundComponentData        SoundComponentData;
  865. typedef SoundComponentData *            SoundComponentDataPtr;
  866. typedef struct SoundParamBlock             SoundParamBlock;
  867.  
  868. typedef SoundParamBlock *                SoundParamBlockPtr;
  869. typedef CALLBACK_API( Boolean , SoundParamProcPtr )(SoundParamBlockPtr *pb);
  870. typedef STACK_UPP_TYPE(SoundParamProcPtr)                         SoundParamUPP;
  871.  
  872. struct SoundParamBlock {
  873.     long                             recordSize;                    /*size of this record in bytes*/
  874.     SoundComponentData                 desc;                        /*description of sound buffer*/
  875.     UnsignedFixed                     rateMultiplier;                /*rate multiplier to apply to sound*/
  876.     short                             leftVolume;                    /*volumes to apply to sound*/
  877.     short                             rightVolume;
  878.     long                             quality;                    /*quality to apply to sound*/
  879.     ComponentInstance                 filter;                        /*filter to apply to sound*/
  880.     SoundParamUPP                     moreRtn;                    /*routine to call to get more data*/
  881.     SoundParamUPP                     completionRtn;                /*routine to call when buffer is complete*/
  882.     long                             refCon;                        /*user refcon*/
  883.     short                             result;                        /*result*/
  884. };
  885.  
  886.  
  887. struct CompressionInfo {
  888.     long                             recordSize;
  889.     OSType                             format;
  890.     short                             compressionID;
  891.     unsigned short                     samplesPerPacket;
  892.     unsigned short                     bytesPerPacket;
  893.     unsigned short                     bytesPerFrame;
  894.     unsigned short                     bytesPerSample;
  895.     unsigned short                     futureUse1;
  896. };
  897. typedef struct CompressionInfo            CompressionInfo;
  898. typedef CompressionInfo *                CompressionInfoPtr;
  899. typedef CompressionInfoPtr *            CompressionInfoHandle;
  900. /*variables for floating point conversion*/
  901.  
  902. struct SoundSlopeAndInterceptRecord {
  903.     Float64                         slope;
  904.     Float64                         intercept;
  905.     Float64                         minClip;
  906.     Float64                         maxClip;
  907. };
  908. typedef struct SoundSlopeAndInterceptRecord SoundSlopeAndInterceptRecord;
  909.  
  910. typedef SoundSlopeAndInterceptRecord *    SoundSlopeAndInterceptPtr;
  911. /*private thing to use as a reference to a Sound Converter*/
  912. typedef struct OpaqueSoundConverter*     SoundConverter;
  913. /*private thing to use as a reference to a Sound Source*/
  914. typedef struct OpaqueSoundSource*         SoundSource;
  915. typedef SoundSource *                    SoundSourcePtr;
  916.  
  917.  
  918.  
  919. struct SoundComponentLink {
  920.     ComponentDescription             description;                /*Describes the sound component*/
  921.     SoundSource                     mixerID;                    /*Reserved by Apple*/
  922.     SoundSource *                    linkID;                        /*Reserved by Apple*/
  923. };
  924. typedef struct SoundComponentLink        SoundComponentLink;
  925. typedef SoundComponentLink *            SoundComponentLinkPtr;
  926.  
  927. struct AudioInfo {
  928.     long                             capabilitiesFlags;            /*Describes device capabilities*/
  929.     long                             reserved;                    /*Reserved by Apple*/
  930.     unsigned short                     numVolumeSteps;                /*Number of significant increments between min and max volume*/
  931. };
  932. typedef struct AudioInfo                AudioInfo;
  933. typedef AudioInfo *                        AudioInfoPtr;
  934.  
  935. struct AudioFormatAtom {
  936.     long                             size;                        /* = sizeof(AudioFormatAtom)*/
  937.     OSType                             atomType;                    /* = kAudioFormatAtomType*/
  938.     OSType                             format;
  939. };
  940. typedef struct AudioFormatAtom            AudioFormatAtom;
  941. typedef AudioFormatAtom *                AudioFormatAtomPtr;
  942.  
  943. struct AudioEndianAtom {
  944.     long                             size;                        /* = sizeof(AudioEndianAtom)*/
  945.     OSType                             atomType;                    /* = kAudioEndianAtomType*/
  946.     short                             littleEndian;
  947. };
  948. typedef struct AudioEndianAtom            AudioEndianAtom;
  949. typedef AudioEndianAtom *                AudioEndianAtomPtr;
  950.  
  951. struct AudioTerminatorAtom {
  952.     long                             size;                        /* = sizeof(AudioTerminatorAtom)*/
  953.     OSType                             atomType;                    /* = kAudioTerminatorAtomType*/
  954. };
  955. typedef struct AudioTerminatorAtom        AudioTerminatorAtom;
  956. typedef AudioTerminatorAtom *            AudioTerminatorAtomPtr;
  957.  
  958.  
  959. /* Sound Input Structures*/
  960. typedef struct SPB                         SPB;
  961.  
  962. typedef SPB *                            SPBPtr;
  963.  
  964.  
  965. /*user procedures called by sound input routines*/
  966. typedef CALLBACK_API( void , SIInterruptProcPtr )(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize);
  967. /*
  968.     WARNING: SIInterruptProcPtr uses register based parameters under classic 68k
  969.              and cannot be written in a high-level language without 
  970.              the help of mixed mode or assembly glue.
  971. */
  972. typedef CALLBACK_API( void , FilePlayCompletionProcPtr )(SndChannelPtr chan);
  973. typedef CALLBACK_API( void , SICompletionProcPtr )(SPBPtr inParamPtr);
  974. typedef REGISTER_UPP_TYPE(SIInterruptProcPtr)                     SIInterruptUPP;
  975. typedef STACK_UPP_TYPE(FilePlayCompletionProcPtr)                 FilePlayCompletionUPP;
  976. typedef STACK_UPP_TYPE(SICompletionProcPtr)                     SICompletionUPP;
  977.  
  978.  
  979. /*Sound Input Parameter Block*/
  980.  
  981. struct SPB {
  982.     long                             inRefNum;                    /*reference number of sound input device*/
  983.     unsigned long                     count;                        /*number of bytes to record*/
  984.     unsigned long                     milliseconds;                /*number of milliseconds to record*/
  985.     unsigned long                     bufferLength;                /*length of buffer in bytes*/
  986.     Ptr                             bufferPtr;                    /*buffer to store sound data in*/
  987.     SICompletionUPP                 completionRoutine;            /*completion routine*/
  988.     SIInterruptUPP                     interruptRoutine;            /*interrupt routine*/
  989.     long                             userLong;                    /*user-defined field*/
  990.     OSErr                             error;                        /*error*/
  991.     long                             unused1;                    /*reserved - must be zero*/
  992. };
  993.  
  994. /*
  995.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  996.    prototypes
  997.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  998. */
  999.  
  1000.  
  1001.  
  1002. /*
  1003.    These two routines for Get/SetSoundVol should no longer be used.
  1004.    They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  1005.    Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  1006. */
  1007.  
  1008. #if TARGET_CPU_68K
  1009. EXTERN_API( void )
  1010. SetSoundVol                        (short                     level);
  1011.  
  1012.  
  1013.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1014.                                                                                             #pragma parameter GetSoundVol(__A0)
  1015.                                                                                             #endif
  1016. EXTERN_API( void )
  1017. GetSoundVol                        (short *                level)                                THREEWORDINLINE(0x4218, 0x10B8, 0x0260);
  1018.  
  1019. #endif  /* TARGET_CPU_68K */
  1020.  
  1021. /* Sound Manager routines */
  1022. EXTERN_API( void )
  1023. SysBeep                            (short                     duration)                            ONEWORDINLINE(0xA9C8);
  1024.  
  1025. EXTERN_API( OSErr )
  1026. SndDoCommand                    (SndChannelPtr             chan,
  1027.                                  const SndCommand *        cmd,
  1028.                                  Boolean                 noWait)                                ONEWORDINLINE(0xA803);
  1029.  
  1030. EXTERN_API( OSErr )
  1031. SndDoImmediate                    (SndChannelPtr             chan,
  1032.                                  const SndCommand *        cmd)                                ONEWORDINLINE(0xA804);
  1033.  
  1034. EXTERN_API( OSErr )
  1035. SndNewChannel                    (SndChannelPtr *        chan,
  1036.                                  short                     synth,
  1037.                                  long                     init,
  1038.                                  SndCallBackUPP         userRoutine)                        ONEWORDINLINE(0xA807);
  1039.  
  1040. EXTERN_API( OSErr )
  1041. SndDisposeChannel                (SndChannelPtr             chan,
  1042.                                  Boolean                 quietNow)                            ONEWORDINLINE(0xA801);
  1043.  
  1044. EXTERN_API( OSErr )
  1045. SndPlay                            (SndChannelPtr             chan,
  1046.                                  SndListHandle             sndHandle,
  1047.                                  Boolean                 async)                                ONEWORDINLINE(0xA805);
  1048.  
  1049. #if OLDROUTINENAMES
  1050. EXTERN_API( OSErr )
  1051. SndAddModifier                    (SndChannelPtr             chan,
  1052.                                  Ptr                     modifier,
  1053.                                  short                     id,
  1054.                                  long                     init)                                ONEWORDINLINE(0xA802);
  1055.  
  1056. #endif  /* OLDROUTINENAMES */
  1057.  
  1058. EXTERN_API( OSErr )
  1059. SndControl                        (short                     id,
  1060.                                  SndCommand *            cmd)                                ONEWORDINLINE(0xA806);
  1061.  
  1062. /* Sound Manager 2.0 and later, uses _SoundDispatch */
  1063. EXTERN_API( NumVersion )
  1064. SndSoundManagerVersion            (void)                                                        FOURWORDINLINE(0x203C, 0x000C, 0x0008, 0xA800);
  1065.  
  1066. EXTERN_API( OSErr )
  1067. SndStartFilePlay                (SndChannelPtr             chan,
  1068.                                  short                     fRefNum,
  1069.                                  short                     resNum,
  1070.                                  long                     bufferSize,
  1071.                                  void *                    theBuffer,
  1072.                                  AudioSelectionPtr         theSelection,
  1073.                                  FilePlayCompletionUPP     theCompletion,
  1074.                                  Boolean                 async)                                FOURWORDINLINE(0x203C, 0x0D00, 0x0008, 0xA800);
  1075.  
  1076. EXTERN_API( OSErr )
  1077. SndPauseFilePlay                (SndChannelPtr             chan)                                FOURWORDINLINE(0x203C, 0x0204, 0x0008, 0xA800);
  1078.  
  1079. EXTERN_API( OSErr )
  1080. SndStopFilePlay                    (SndChannelPtr             chan,
  1081.                                  Boolean                 quietNow)                            FOURWORDINLINE(0x203C, 0x0308, 0x0008, 0xA800);
  1082.  
  1083. EXTERN_API( OSErr )
  1084. SndChannelStatus                (SndChannelPtr             chan,
  1085.                                  short                     theLength,
  1086.                                  SCStatusPtr             theStatus)                            FOURWORDINLINE(0x203C, 0x0510, 0x0008, 0xA800);
  1087.  
  1088. EXTERN_API( OSErr )
  1089. SndManagerStatus                (short                     theLength,
  1090.                                  SMStatusPtr             theStatus)                            FOURWORDINLINE(0x203C, 0x0314, 0x0008, 0xA800);
  1091.  
  1092. EXTERN_API( void )
  1093. SndGetSysBeepState                (short *                sysBeepState)                        FOURWORDINLINE(0x203C, 0x0218, 0x0008, 0xA800);
  1094.  
  1095. EXTERN_API( OSErr )
  1096. SndSetSysBeepState                (short                     sysBeepState)                        FOURWORDINLINE(0x203C, 0x011C, 0x0008, 0xA800);
  1097.  
  1098. EXTERN_API( OSErr )
  1099. SndPlayDoubleBuffer                (SndChannelPtr             chan,
  1100.                                  SndDoubleBufferHeaderPtr  theParams)                        FOURWORDINLINE(0x203C, 0x0420, 0x0008, 0xA800);
  1101.  
  1102. /* MACE compression routines, uses _SoundDispatch */
  1103. EXTERN_API( NumVersion )
  1104. MACEVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0010, 0xA800);
  1105.  
  1106. EXTERN_API( void )
  1107. Comp3to1                        (const void *            inBuffer,
  1108.                                  void *                    outBuffer,
  1109.                                  unsigned long             cnt,
  1110.                                  StateBlockPtr             inState,
  1111.                                  StateBlockPtr             outState,
  1112.                                  unsigned long             numChannels,
  1113.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x0004, 0x0010, 0xA800);
  1114.  
  1115. EXTERN_API( void )
  1116. Exp1to3                            (const void *            inBuffer,
  1117.                                  void *                    outBuffer,
  1118.                                  unsigned long             cnt,
  1119.                                  StateBlockPtr             inState,
  1120.                                  StateBlockPtr             outState,
  1121.                                  unsigned long             numChannels,
  1122.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x0008, 0x0010, 0xA800);
  1123.  
  1124. EXTERN_API( void )
  1125. Comp6to1                        (const void *            inBuffer,
  1126.                                  void *                    outBuffer,
  1127.                                  unsigned long             cnt,
  1128.                                  StateBlockPtr             inState,
  1129.                                  StateBlockPtr             outState,
  1130.                                  unsigned long             numChannels,
  1131.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x000C, 0x0010, 0xA800);
  1132.  
  1133. EXTERN_API( void )
  1134. Exp1to6                            (const void *            inBuffer,
  1135.                                  void *                    outBuffer,
  1136.                                  unsigned long             cnt,
  1137.                                  StateBlockPtr             inState,
  1138.                                  StateBlockPtr             outState,
  1139.                                  unsigned long             numChannels,
  1140.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xA800);
  1141.  
  1142. /* Sound Manager 3.0 and later calls, uses _SoundDispatch */
  1143. EXTERN_API( OSErr )
  1144. GetSysBeepVolume                (long *                    level)                                FOURWORDINLINE(0x203C, 0x0224, 0x0018, 0xA800);
  1145.  
  1146. EXTERN_API( OSErr )
  1147. SetSysBeepVolume                (long                     level)                                FOURWORDINLINE(0x203C, 0x0228, 0x0018, 0xA800);
  1148.  
  1149. EXTERN_API( OSErr )
  1150. GetDefaultOutputVolume            (long *                    level)                                FOURWORDINLINE(0x203C, 0x022C, 0x0018, 0xA800);
  1151.  
  1152. EXTERN_API( OSErr )
  1153. SetDefaultOutputVolume            (long                     level)                                FOURWORDINLINE(0x203C, 0x0230, 0x0018, 0xA800);
  1154.  
  1155. EXTERN_API( OSErr )
  1156. GetSoundHeaderOffset            (SndListHandle             sndHandle,
  1157.                                  long *                    offset)                                FOURWORDINLINE(0x203C, 0x0404, 0x0018, 0xA800);
  1158.  
  1159. EXTERN_API( UnsignedFixed )
  1160. UnsignedFixedMulDiv                (UnsignedFixed             value,
  1161.                                  UnsignedFixed             multiplier,
  1162.                                  UnsignedFixed             divisor)                            FOURWORDINLINE(0x203C, 0x060C, 0x0018, 0xA800);
  1163.  
  1164. EXTERN_API( OSErr )
  1165. GetCompressionInfo                (short                     compressionID,
  1166.                                  OSType                 format,
  1167.                                  short                     numChannels,
  1168.                                  short                     sampleSize,
  1169.                                  CompressionInfoPtr     cp)                                    FOURWORDINLINE(0x203C, 0x0710, 0x0018, 0xA800);
  1170.  
  1171. EXTERN_API( OSErr )
  1172. SetSoundPreference                (OSType                 theType,
  1173.                                  Str255                 name,
  1174.                                  Handle                 settings)                            FOURWORDINLINE(0x203C, 0x0634, 0x0018, 0xA800);
  1175.  
  1176. EXTERN_API( OSErr )
  1177. GetSoundPreference                (OSType                 theType,
  1178.                                  Str255                 name,
  1179.                                  Handle                 settings)                            FOURWORDINLINE(0x203C, 0x0638, 0x0018, 0xA800);
  1180.  
  1181. EXTERN_API( OSErr )
  1182. OpenMixerSoundComponent            (SoundComponentDataPtr     outputDescription,
  1183.                                  long                     outputFlags,
  1184.                                  ComponentInstance *    mixerComponent)                        FOURWORDINLINE(0x203C, 0x0614, 0x0018, 0xA800);
  1185.  
  1186. EXTERN_API( OSErr )
  1187. CloseMixerSoundComponent        (ComponentInstance         ci)                                    FOURWORDINLINE(0x203C, 0x0218, 0x0018, 0xA800);
  1188.  
  1189. /* Sound Manager 3.1 and later calls, uses _SoundDispatch */
  1190. EXTERN_API( OSErr )
  1191. SndGetInfo                        (SndChannelPtr             chan,
  1192.                                  OSType                 selector,
  1193.                                  void *                    infoPtr)                            FOURWORDINLINE(0x203C, 0x063C, 0x0018, 0xA800);
  1194.  
  1195. EXTERN_API( OSErr )
  1196. SndSetInfo                        (SndChannelPtr             chan,
  1197.                                  OSType                 selector,
  1198.                                  const void *            infoPtr)                            FOURWORDINLINE(0x203C, 0x0640, 0x0018, 0xA800);
  1199.  
  1200. EXTERN_API( OSErr )
  1201. GetSoundOutputInfo                (Component                 outputDevice,
  1202.                                  OSType                 selector,
  1203.                                  void *                    infoPtr)                            FOURWORDINLINE(0x203C, 0x0644, 0x0018, 0xA800);
  1204.  
  1205. EXTERN_API( OSErr )
  1206. SetSoundOutputInfo                (Component                 outputDevice,
  1207.                                  OSType                 selector,
  1208.                                  const void *            infoPtr)                            FOURWORDINLINE(0x203C, 0x0648, 0x0018, 0xA800);
  1209.  
  1210. /* Sound Manager 3.2 and later calls, uses _SoundDispatch */
  1211. EXTERN_API( OSErr )
  1212. GetCompressionName                (OSType                 compressionType,
  1213.                                  Str255                 compressionName)                    FOURWORDINLINE(0x203C, 0x044C, 0x0018, 0xA800);
  1214.  
  1215. EXTERN_API( OSErr )
  1216. SoundConverterOpen                (const SoundComponentData * inputFormat,
  1217.                                  const SoundComponentData * outputFormat,
  1218.                                  SoundConverter *        sc)                                    FOURWORDINLINE(0x203C, 0x0650, 0x0018, 0xA800);
  1219.  
  1220. EXTERN_API( OSErr )
  1221. SoundConverterClose                (SoundConverter         sc)                                    FOURWORDINLINE(0x203C, 0x0254, 0x0018, 0xA800);
  1222.  
  1223. EXTERN_API( OSErr )
  1224. SoundConverterGetBufferSizes    (SoundConverter         sc,
  1225.                                  unsigned long             inputBytesTarget,
  1226.                                  unsigned long *        inputFrames,
  1227.                                  unsigned long *        inputBytes,
  1228.                                  unsigned long *        outputBytes)                        FOURWORDINLINE(0x203C, 0x0A58, 0x0018, 0xA800);
  1229.  
  1230. EXTERN_API( OSErr )
  1231. SoundConverterBeginConversion    (SoundConverter         sc)                                    FOURWORDINLINE(0x203C, 0x025C, 0x0018, 0xA800);
  1232.  
  1233. EXTERN_API( OSErr )
  1234. SoundConverterConvertBuffer        (SoundConverter         sc,
  1235.                                  const void *            inputPtr,
  1236.                                  unsigned long             inputFrames,
  1237.                                  void *                    outputPtr,
  1238.                                  unsigned long *        outputFrames,
  1239.                                  unsigned long *        outputBytes)                        FOURWORDINLINE(0x203C, 0x0C60, 0x0018, 0xA800);
  1240.  
  1241. EXTERN_API( OSErr )
  1242. SoundConverterEndConversion        (SoundConverter         sc,
  1243.                                  void *                    outputPtr,
  1244.                                  unsigned long *        outputFrames,
  1245.                                  unsigned long *        outputBytes)                        FOURWORDINLINE(0x203C, 0x0864, 0x0018, 0xA800);
  1246.  
  1247. /* Sound Manager 3.3 and later calls, uses _SoundDispatch */
  1248. EXTERN_API( OSErr )
  1249. SoundConverterGetInfo            (SoundConverter         sc,
  1250.                                  OSType                 selector,
  1251.                                  void *                    infoPtr)                            FOURWORDINLINE(0x203C, 0x0668, 0x0018, 0xA800);
  1252.  
  1253. EXTERN_API( OSErr )
  1254. SoundConverterSetInfo            (SoundConverter         sc,
  1255.                                  OSType                 selector,
  1256.                                  void *                    infoPtr)                            FOURWORDINLINE(0x203C, 0x066C, 0x0018, 0xA800);
  1257.  
  1258. /*
  1259.   Sound Component Functions
  1260.    basic sound component functions
  1261. */
  1262.  
  1263. EXTERN_API( ComponentResult )
  1264. SoundComponentInitOutputDevice    (ComponentInstance         ti,
  1265.                                  long                     actions)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1266.  
  1267. EXTERN_API( ComponentResult )
  1268. SoundComponentSetSource            (ComponentInstance         ti,
  1269.                                  SoundSource             sourceID,
  1270.                                  ComponentInstance         source)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  1271.  
  1272. EXTERN_API( ComponentResult )
  1273. SoundComponentGetSource            (ComponentInstance         ti,
  1274.                                  SoundSource             sourceID,
  1275.                                  ComponentInstance *    source)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  1276.  
  1277. EXTERN_API( ComponentResult )
  1278. SoundComponentGetSourceData        (ComponentInstance         ti,
  1279.                                  SoundComponentDataPtr * sourceData)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1280.  
  1281. EXTERN_API( ComponentResult )
  1282. SoundComponentSetOutput            (ComponentInstance         ti,
  1283.                                  SoundComponentDataPtr     requested,
  1284.                                  SoundComponentDataPtr * actual)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0005, 0x7000, 0xA82A);
  1285.  
  1286. /* junction methods for the mixer, must be called at non-interrupt level*/
  1287. EXTERN_API( ComponentResult )
  1288. SoundComponentAddSource            (ComponentInstance         ti,
  1289.                                  SoundSource *            sourceID)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  1290.  
  1291. EXTERN_API( ComponentResult )
  1292. SoundComponentRemoveSource        (ComponentInstance         ti,
  1293.                                  SoundSource             sourceID)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  1294.  
  1295. /* info methods*/
  1296. EXTERN_API( ComponentResult )
  1297. SoundComponentGetInfo            (ComponentInstance         ti,
  1298.                                  SoundSource             sourceID,
  1299.                                  OSType                 selector,
  1300.                                  void *                    infoPtr)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  1301.  
  1302. EXTERN_API( ComponentResult )
  1303. SoundComponentSetInfo            (ComponentInstance         ti,
  1304.                                  SoundSource             sourceID,
  1305.                                  OSType                 selector,
  1306.                                  void *                    infoPtr)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0104, 0x7000, 0xA82A);
  1307.  
  1308. /* control methods*/
  1309. EXTERN_API( ComponentResult )
  1310. SoundComponentStartSource        (ComponentInstance         ti,
  1311.                                  short                     count,
  1312.                                  SoundSource *            sources)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0105, 0x7000, 0xA82A);
  1313.  
  1314. EXTERN_API( ComponentResult )
  1315. SoundComponentStopSource        (ComponentInstance         ti,
  1316.                                  short                     count,
  1317.                                  SoundSource *            sources)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0106, 0x7000, 0xA82A);
  1318.  
  1319. EXTERN_API( ComponentResult )
  1320. SoundComponentPauseSource        (ComponentInstance         ti,
  1321.                                  short                     count,
  1322.                                  SoundSource *            sources)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0107, 0x7000, 0xA82A);
  1323.  
  1324. EXTERN_API( ComponentResult )
  1325. SoundComponentPlaySourceBuffer    (ComponentInstance         ti,
  1326.                                  SoundSource             sourceID,
  1327.                                  SoundParamBlockPtr     pb,
  1328.                                  long                     actions)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0108, 0x7000, 0xA82A);
  1329.  
  1330. /*Audio Components*/
  1331. /*Volume is described as a value between 0 and 1, with 0 indicating minimum
  1332.   volume and 1 indicating maximum volume; if the device doesn't support
  1333.   software control of volume, then a value of unimpErr is returned, indicating
  1334.   that these functions are not supported by the device*/
  1335. EXTERN_API( ComponentResult )
  1336. AudioGetVolume                    (ComponentInstance         ac,
  1337.                                  short                     whichChannel,
  1338.                                  ShortFixed *            volume)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0000, 0x7000, 0xA82A);
  1339.  
  1340. EXTERN_API( ComponentResult )
  1341. AudioSetVolume                    (ComponentInstance         ac,
  1342.                                  short                     whichChannel,
  1343.                                  ShortFixed             volume)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1344.  
  1345. /*If the device doesn't support software control of mute, then a value of unimpErr is
  1346. returned, indicating that these functions are not supported by the device.*/
  1347. EXTERN_API( ComponentResult )
  1348. AudioGetMute                    (ComponentInstance         ac,
  1349.                                  short                     whichChannel,
  1350.                                  short *                mute)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0002, 0x7000, 0xA82A);
  1351.  
  1352. EXTERN_API( ComponentResult )
  1353. AudioSetMute                    (ComponentInstance         ac,
  1354.                                  short                     whichChannel,
  1355.                                  short                     mute)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  1356.  
  1357. /*AudioSetToDefaults causes the associated device to reset its volume and mute values
  1358. (and perhaps other characteristics, e.g. attenuation) to "factory default" settings*/
  1359. EXTERN_API( ComponentResult )
  1360. AudioSetToDefaults                (ComponentInstance         ac)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  1361.  
  1362. /*This routine is required; it must be implemented by all audio components*/
  1363.  
  1364. EXTERN_API( ComponentResult )
  1365. AudioGetInfo                    (ComponentInstance         ac,
  1366.                                  AudioInfoPtr             info)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1367.  
  1368. EXTERN_API( ComponentResult )
  1369. AudioGetBass                    (ComponentInstance         ac,
  1370.                                  short                     whichChannel,
  1371.                                  short *                bass)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);
  1372.  
  1373. EXTERN_API( ComponentResult )
  1374. AudioSetBass                    (ComponentInstance         ac,
  1375.                                  short                     whichChannel,
  1376.                                  short                     bass)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1377.  
  1378. EXTERN_API( ComponentResult )
  1379. AudioGetTreble                    (ComponentInstance         ac,
  1380.                                  short                     whichChannel,
  1381.                                  short *                Treble)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0008, 0x7000, 0xA82A);
  1382.  
  1383. EXTERN_API( ComponentResult )
  1384. AudioSetTreble                    (ComponentInstance         ac,
  1385.                                  short                     whichChannel,
  1386.                                  short                     Treble)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0009, 0x7000, 0xA82A);
  1387.  
  1388. EXTERN_API( ComponentResult )
  1389. AudioGetOutputDevice            (ComponentInstance         ac,
  1390.                                  Component *            outputDevice)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
  1391.  
  1392.  
  1393. /*This is routine is private to the AudioVision component.  It enables the watching of the mute key.*/
  1394. EXTERN_API( ComponentResult )
  1395. AudioMuteOnEvent                (ComponentInstance         ac,
  1396.                                  short                     muteOnEvent)                        FIVEWORDINLINE(0x2F3C, 0x0002, 0x0081, 0x7000, 0xA82A);
  1397.  
  1398.  
  1399. /* selectors for component calls */
  1400. enum {
  1401.     kSoundComponentInitOutputDeviceSelect            = 0x0001,
  1402.     kSoundComponentSetSourceSelect                    = 0x0002,
  1403.     kSoundComponentGetSourceSelect                    = 0x0003,
  1404.     kSoundComponentGetSourceDataSelect                = 0x0004,
  1405.     kSoundComponentSetOutputSelect                    = 0x0005,
  1406.     kSoundComponentAddSourceSelect                    = 0x0101,
  1407.     kSoundComponentRemoveSourceSelect                = 0x0102,
  1408.     kSoundComponentGetInfoSelect                    = 0x0103,
  1409.     kSoundComponentSetInfoSelect                    = 0x0104,
  1410.     kSoundComponentStartSourceSelect                = 0x0105,
  1411.     kSoundComponentStopSourceSelect                    = 0x0106,
  1412.     kSoundComponentPauseSourceSelect                = 0x0107,
  1413.     kSoundComponentPlaySourceBufferSelect            = 0x0108,
  1414.     kAudioGetVolumeSelect                            = 0x0000,
  1415.     kAudioSetVolumeSelect                            = 0x0001,
  1416.     kAudioGetMuteSelect                                = 0x0002,
  1417.     kAudioSetMuteSelect                                = 0x0003,
  1418.     kAudioSetToDefaultsSelect                        = 0x0004,
  1419.     kAudioGetInfoSelect                                = 0x0005,
  1420.     kAudioGetBassSelect                                = 0x0006,
  1421.     kAudioSetBassSelect                                = 0x0007,
  1422.     kAudioGetTrebleSelect                            = 0x0008,
  1423.     kAudioSetTrebleSelect                            = 0x0009,
  1424.     kAudioGetOutputDeviceSelect                        = 0x000A,
  1425.     kAudioMuteOnEventSelect                            = 0x0081
  1426. };
  1427.  
  1428. enum {
  1429.     kDelegatedSoundComponentSelectors = 0x0100
  1430. };
  1431.  
  1432.  
  1433.  
  1434. /* Sound Input Manager routines, uses _SoundDispatch */
  1435. EXTERN_API( NumVersion )
  1436. SPBVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0014, 0xA800);
  1437.  
  1438. EXTERN_API( OSErr )
  1439. SndRecord                        (ModalFilterUPP         filterProc,
  1440.                                  Point                     corner,
  1441.                                  OSType                 quality,
  1442.                                  SndListHandle *        sndHandle)                            FOURWORDINLINE(0x203C, 0x0804, 0x0014, 0xA800);
  1443.  
  1444. EXTERN_API( OSErr )
  1445. SndRecordToFile                    (ModalFilterUPP         filterProc,
  1446.                                  Point                     corner,
  1447.                                  OSType                 quality,
  1448.                                  short                     fRefNum)                            FOURWORDINLINE(0x203C, 0x0708, 0x0014, 0xA800);
  1449.  
  1450. EXTERN_API( OSErr )
  1451. SPBSignInDevice                    (short                     deviceRefNum,
  1452.                                  ConstStr255Param         deviceName)                            FOURWORDINLINE(0x203C, 0x030C, 0x0014, 0xA800);
  1453.  
  1454. EXTERN_API( OSErr )
  1455. SPBSignOutDevice                (short                     deviceRefNum)                        FOURWORDINLINE(0x203C, 0x0110, 0x0014, 0xA800);
  1456.  
  1457. EXTERN_API( OSErr )
  1458. SPBGetIndexedDevice                (short                     count,
  1459.                                  Str255                 deviceName,
  1460.                                  Handle *                deviceIconHandle)                    FOURWORDINLINE(0x203C, 0x0514, 0x0014, 0xA800);
  1461.  
  1462. EXTERN_API( OSErr )
  1463. SPBOpenDevice                    (ConstStr255Param         deviceName,
  1464.                                  short                     permission,
  1465.                                  long *                    inRefNum)                            FOURWORDINLINE(0x203C, 0x0518, 0x0014, 0xA800);
  1466.  
  1467. EXTERN_API( OSErr )
  1468. SPBCloseDevice                    (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x021C, 0x0014, 0xA800);
  1469.  
  1470. EXTERN_API( OSErr )
  1471. SPBRecord                        (SPBPtr                 inParamPtr,
  1472.                                  Boolean                 asynchFlag)                            FOURWORDINLINE(0x203C, 0x0320, 0x0014, 0xA800);
  1473.  
  1474. EXTERN_API( OSErr )
  1475. SPBRecordToFile                    (short                     fRefNum,
  1476.                                  SPBPtr                 inParamPtr,
  1477.                                  Boolean                 asynchFlag)                            FOURWORDINLINE(0x203C, 0x0424, 0x0014, 0xA800);
  1478.  
  1479. EXTERN_API( OSErr )
  1480. SPBPauseRecording                (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x0228, 0x0014, 0xA800);
  1481.  
  1482. EXTERN_API( OSErr )
  1483. SPBResumeRecording                (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x022C, 0x0014, 0xA800);
  1484.  
  1485. EXTERN_API( OSErr )
  1486. SPBStopRecording                (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x0230, 0x0014, 0xA800);
  1487.  
  1488. EXTERN_API( OSErr )
  1489. SPBGetRecordingStatus            (long                     inRefNum,
  1490.                                  short *                recordingStatus,
  1491.                                  short *                meterLevel,
  1492.                                  unsigned long *        totalSamplesToRecord,
  1493.                                  unsigned long *        numberOfSamplesRecorded,
  1494.                                  unsigned long *        totalMsecsToRecord,
  1495.                                  unsigned long *        numberOfMsecsRecorded)                FOURWORDINLINE(0x203C, 0x0E34, 0x0014, 0xA800);
  1496.  
  1497. EXTERN_API( OSErr )
  1498. SPBGetDeviceInfo                (long                     inRefNum,
  1499.                                  OSType                 infoType,
  1500.                                  void *                    infoData)                            FOURWORDINLINE(0x203C, 0x0638, 0x0014, 0xA800);
  1501.  
  1502. EXTERN_API( OSErr )
  1503. SPBSetDeviceInfo                (long                     inRefNum,
  1504.                                  OSType                 infoType,
  1505.                                  void *                    infoData)                            FOURWORDINLINE(0x203C, 0x063C, 0x0014, 0xA800);
  1506.  
  1507. EXTERN_API( OSErr )
  1508. SPBMillisecondsToBytes            (long                     inRefNum,
  1509.                                  long *                    milliseconds)                        FOURWORDINLINE(0x203C, 0x0440, 0x0014, 0xA800);
  1510.  
  1511. EXTERN_API( OSErr )
  1512. SPBBytesToMilliseconds            (long                     inRefNum,
  1513.                                  long *                    byteCount)                            FOURWORDINLINE(0x203C, 0x0444, 0x0014, 0xA800);
  1514.  
  1515. EXTERN_API( OSErr )
  1516. SetupSndHeader                    (SndListHandle             sndHandle,
  1517.                                  short                     numChannels,
  1518.                                  UnsignedFixed             sampleRate,
  1519.                                  short                     sampleSize,
  1520.                                  OSType                 compressionType,
  1521.                                  short                     baseNote,
  1522.                                  unsigned long             numBytes,
  1523.                                  short *                headerLen)                            FOURWORDINLINE(0x203C, 0x0D48, 0x0014, 0xA800);
  1524.  
  1525. EXTERN_API( OSErr )
  1526. SetupAIFFHeader                    (short                     fRefNum,
  1527.                                  short                     numChannels,
  1528.                                  UnsignedFixed             sampleRate,
  1529.                                  short                     sampleSize,
  1530.                                  OSType                 compressionType,
  1531.                                  unsigned long             numBytes,
  1532.                                  unsigned long             numFrames)                            FOURWORDINLINE(0x203C, 0x0B4C, 0x0014, 0xA800);
  1533.  
  1534. /* Sound Input Manager 1.1 and later calls, uses _SoundDispatch */
  1535. EXTERN_API( OSErr )
  1536. ParseAIFFHeader                    (short                     fRefNum,
  1537.                                  SoundComponentData *    sndInfo,
  1538.                                  unsigned long *        numFrames,
  1539.                                  unsigned long *        dataOffset)                            FOURWORDINLINE(0x203C, 0x0758, 0x0014, 0xA800);
  1540.  
  1541. EXTERN_API( OSErr )
  1542. ParseSndHeader                    (SndListHandle             sndHandle,
  1543.                                  SoundComponentData *    sndInfo,
  1544.                                  unsigned long *        numFrames,
  1545.                                  unsigned long *        dataOffset)                            FOURWORDINLINE(0x203C, 0x085C, 0x0014, 0xA800);
  1546.  
  1547. enum { uppSndCallBackProcInfo = 0x000003C0 };                     /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1548. enum { uppSndDoubleBackProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1549. enum { uppSoundParamProcInfo = 0x000000D0 };                     /* pascal 1_byte Func(4_bytes) */
  1550. enum { uppSIInterruptProcInfo = 0x1C579802 };                     /* register no_return_value Func(4_bytes:A0, 4_bytes:A1, 2_bytes:D0, 4_bytes:D1) */
  1551. enum { uppFilePlayCompletionProcInfo = 0x000000C0 };             /* pascal no_return_value Func(4_bytes) */
  1552. enum { uppSICompletionProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  1553. #define NewSndCallBackProc(userRoutine)                         (SndCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndCallBackProcInfo, GetCurrentArchitecture())
  1554. #define NewSndDoubleBackProc(userRoutine)                         (SndDoubleBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndDoubleBackProcInfo, GetCurrentArchitecture())
  1555. #define NewSoundParamProc(userRoutine)                             (SoundParamUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundParamProcInfo, GetCurrentArchitecture())
  1556. #define NewSIInterruptProc(userRoutine)                         (SIInterruptUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSIInterruptProcInfo, GetCurrentArchitecture())
  1557. #define NewFilePlayCompletionProc(userRoutine)                     (FilePlayCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFilePlayCompletionProcInfo, GetCurrentArchitecture())
  1558. #define NewSICompletionProc(userRoutine)                         (SICompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICompletionProcInfo, GetCurrentArchitecture())
  1559. #define CallSndCallBackProc(userRoutine, chan, cmd)             CALL_TWO_PARAMETER_UPP((userRoutine), uppSndCallBackProcInfo, (chan), (cmd))
  1560. #define CallSndDoubleBackProc(userRoutine, channel, doubleBufferPtr)  CALL_TWO_PARAMETER_UPP((userRoutine), uppSndDoubleBackProcInfo, (channel), (doubleBufferPtr))
  1561. #define CallSoundParamProc(userRoutine, pb)                     CALL_ONE_PARAMETER_UPP((userRoutine), uppSoundParamProcInfo, (pb))
  1562. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1563.     /* CallSIInterruptProc can't be called from classic 68k without glue code */
  1564. #else
  1565.     #define CallSIInterruptProc(userRoutine, inParamPtr, dataBuffer, peakAmplitude, sampleSize)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppSIInterruptProcInfo, (inParamPtr), (dataBuffer), (peakAmplitude), (sampleSize))
  1566. #endif
  1567. #define CallFilePlayCompletionProc(userRoutine, chan)             CALL_ONE_PARAMETER_UPP((userRoutine), uppFilePlayCompletionProcInfo, (chan))
  1568. #define CallSICompletionProc(userRoutine, inParamPtr)             CALL_ONE_PARAMETER_UPP((userRoutine), uppSICompletionProcInfo, (inParamPtr))
  1569.  
  1570.  
  1571.  
  1572.  
  1573. #if !TARGET_OS_MAC
  1574. /*  Only to be used if you are writing a sound input component; this */
  1575. /*  is the param block for a read request from the SoundMgr to the   */
  1576. /*  sound input component.  Not to be confused with the SPB struct   */
  1577. /*  above, which is the param block for a read request from an app   */
  1578. /*  to the SoundMgr.                                                 */
  1579. typedef struct SndInputCmpParam         SndInputCmpParam;
  1580. typedef SndInputCmpParam *                SndInputCmpParamPtr;
  1581. typedef CALLBACK_API( void , SICCompletionProcPtr )(SndInputCmpParamPtr SICParmPtr);
  1582.  
  1583. struct SndInputCmpParam {
  1584.     SICCompletionProcPtr             ioCompletion;                /* completion routine [pointer]*/
  1585.     SIInterruptProcPtr                 ioInterrupt;                /* interrupt routine [pointer]*/
  1586.     OSErr                             ioResult;                    /* I/O result code [word]*/
  1587.     short                             pad;
  1588.     unsigned long                     ioReqCount;
  1589.     unsigned long                     ioActCount;
  1590.     Ptr                             ioBuffer;
  1591.     Ptr                             ioMisc;
  1592. };
  1593.  
  1594. EXTERN_API( ComponentResult )
  1595. SndInputReadAsync                (ComponentInstance         self,
  1596.                                  SndInputCmpParamPtr     SICParmPtr)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1597.  
  1598. EXTERN_API( ComponentResult )
  1599. SndInputReadSync                (ComponentInstance         self,
  1600.                                  SndInputCmpParamPtr     SICParmPtr)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0002, 0x7000, 0xA82A);
  1601.  
  1602. EXTERN_API( ComponentResult )
  1603. SndInputPauseRecording            (ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  1604.  
  1605. EXTERN_API( ComponentResult )
  1606. SndInputResumeRecording            (ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  1607.  
  1608. EXTERN_API( ComponentResult )
  1609. SndInputStopRecording            (ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0000, 0x0005, 0x7000, 0xA82A);
  1610.  
  1611. EXTERN_API( ComponentResult )
  1612. SndInputGetStatus                (ComponentInstance         self,
  1613.                                  short *                recordingStatus,
  1614.                                  unsigned long *        totalSamplesToRecord,
  1615.                                  unsigned long *        numberOfSamplesRecorded)            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  1616.  
  1617. EXTERN_API( ComponentResult )
  1618. SndInputGetDeviceInfo            (ComponentInstance         self,
  1619.                                  OSType                 infoType,
  1620.                                  void *                    infoData)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0007, 0x7000, 0xA82A);
  1621.  
  1622. EXTERN_API( ComponentResult )
  1623. SndInputSetDeviceInfo            (ComponentInstance         self,
  1624.                                  OSType                 infoType,
  1625.                                  void *                    infoData)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1626.  
  1627. EXTERN_API( ComponentResult )
  1628. SndInputInitHardware            (ComponentInstance         self)                                FIVEWORDINLINE(0x2F3C, 0x0000, 0x0009, 0x7000, 0xA82A);
  1629.  
  1630.  
  1631. /* selectors for component calls */
  1632. enum {
  1633.     kSndInputReadAsyncSelect                        = 0x0001,
  1634.     kSndInputReadSyncSelect                            = 0x0002,
  1635.     kSndInputPauseRecordingSelect                    = 0x0003,
  1636.     kSndInputResumeRecordingSelect                    = 0x0004,
  1637.     kSndInputStopRecordingSelect                    = 0x0005,
  1638.     kSndInputGetStatusSelect                        = 0x0006,
  1639.     kSndInputGetDeviceInfoSelect                    = 0x0007,
  1640.     kSndInputSetDeviceInfoSelect                    = 0x0008,
  1641.     kSndInputInitHardwareSelect                        = 0x0009
  1642. };
  1643. enum { uppSICCompletionProcInfo = 0x000000C0 };                 /* pascal no_return_value Func(4_bytes) */
  1644. #define NewSICCompletionProc(userRoutine)                         (SICCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICCompletionProcInfo, GetCurrentArchitecture())
  1645. #define CallSICCompletionProc(userRoutine, SICParmPtr)             CALL_ONE_PARAMETER_UPP((userRoutine), uppSICCompletionProcInfo, (SICParmPtr))
  1646. #endif  /* !TARGET_OS_MAC */
  1647.  
  1648.  
  1649.  
  1650. #if PRAGMA_STRUCT_ALIGN
  1651.     #pragma options align=reset
  1652. #elif PRAGMA_STRUCT_PACKPUSH
  1653.     #pragma pack(pop)
  1654. #elif PRAGMA_STRUCT_PACK
  1655.     #pragma pack()
  1656. #endif
  1657.  
  1658. #ifdef PRAGMA_IMPORT_OFF
  1659. #pragma import off
  1660. #elif PRAGMA_IMPORT
  1661. #pragma import reset
  1662. #endif
  1663.  
  1664. #ifdef __cplusplus
  1665. }
  1666. #endif
  1667.  
  1668. #endif /* __SOUND__ */
  1669.  
  1670.